package com.xbongbong.admin.domain.entity;

import com.xbongbong.paas.domain.entity.PaasMenuEntity;
import com.xbongbong.paas.toolbox.wrap.Entity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author guohui.zhang
 * @Title: 应用菜单副本表(镜像3.0回退到上一版本)
 * @date 2020/3/179:36
 */
@Getter
@Setter
@ToString
public class PaasMenuRetainEntity extends Entity {

    private static final long serialVersionUID = -5599710501659229567L;
    /**
     * 主键id
     */
    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 备份应用id
     */
    private Long retainAppId;
    /**
     * 原菜单id
     */
    private Long sourceMenuId;
    /**
     * 原应用id
     */
    private Long sourceAppId;

    /**
     * 父类id
     */
    private Long parentId;

    /**
     * 菜单名称
     */
    private String name;

    /**
     * 应用图标
     */
    private String icon;
    /**
     * 颜色，16进制色，如 FF0000
     */
    private String color;

    /**
     * 菜单排序
     */
    private Integer sort;

    /**
     * 菜单类型，1 分组，2 表单，3 表单(开启流程)，4 统计
     */
    private  Integer type;

    /**
     * 创建者userId
     */
    private String creatorId;

    /**
     * 创建时间时间戳
     */
    private Long addTime;

    /**
     * 更新时间时间戳
     */
    private Long updateTime;

    /**
     * 删除标记
     */
    private Integer del;

    /**
     * 菜单标示，主要用于saas菜单识别，如"contractList"
     */
    private String alias;

    /**
     * 1为saas菜单，2为自建菜单
     */
    private Integer saasMark;

    /**
     * 是否启用，1启用，0不启用
     */
    private Integer enable;

    /**
     * 对应的链接
     */
    private String url;
    /**
     * 手机端对应的链接
     */
    private String mobileUrl;
    /**
     * 经销商标识
     */
    private Integer distributorMark;


    public PaasMenuRetainEntity(){
        this.del = 0;
    }


    public PaasMenuRetainEntity(PaasMenuEntity paasMenuEntity) {
        this.corpid = paasMenuEntity.getCorpid();
        this.sourceMenuId = paasMenuEntity.getId();
        this.sourceAppId = paasMenuEntity.getAppId();
        this.parentId = paasMenuEntity.getParentId();
        this.name = paasMenuEntity.getName();
        this.icon = paasMenuEntity.getIcon();
        this.color = paasMenuEntity.getColor();
        this.sort = paasMenuEntity.getSort();
        this.type = paasMenuEntity.getType();
        this.creatorId = paasMenuEntity.getCreatorId();
        this.addTime = paasMenuEntity.getAddTime();
        this.updateTime = paasMenuEntity.getUpdateTime();
        this.del = paasMenuEntity.getDel();
        this.alias = paasMenuEntity.getAlias();
        this.saasMark = paasMenuEntity.getSaasMark();
        this.enable = paasMenuEntity.getEnable();
        this.url = paasMenuEntity.getUrl();
        this.mobileUrl = paasMenuEntity.getMobileUrl();
        this.distributorMark = paasMenuEntity.getDistributorMark();
    }
}
